<extend name="./base" />
<block name="pageContent">
<link rel="stylesheet" href="{$Think.config.DOMAIN_URL}/Public/AdminTpl/css/s-settle.css">
<div class="main-content">
    <!-- 头部面包屑导航条 -->
    <div class="breadcrumbs" id="breadcrumbs">
        <!--导航路径列表-->
        <ul class="breadcrumb no-margin-left">
            <li>
                <a>管理后台</a>
            </li>
            <li class="action">
                用户管理
                <i class="fa fa-times ace-icon"></i>
            </li>
        </ul>
    </div>
    <!--页面容器-->
    <div class="page-content">
        <div class="nav-tab" style="position: relative">
            <ul class="nav-tab-title ">
                <li class="nav-this">用户编辑</li>
            </ul>
        </div>
        <div class="row">
            <ol class="pull-left  clearfix lecturer-contet-title" style="overflow: hidden;margin-bottom: 10px;">
                <li class="pull-left list-back bordereight border-blue" mapid="jbxx">基本信息</li>
                <li class="pull-left bordereight borderleft" mapid="cwxx">财务信息</li>
                <li class="pull-left borderleft" mapid="rzxx">认证信息</li>
            </ol>
            <!-- 基本信息-->
            <div class="col-xs-12 syxx" id="jbxx">
                <div class="pad-t20">
                    <form class="form-horizontal s_input-bgcolor s_overflow">
                        <div class="col-lg-4 col-md-6 col-md-12 col-xs-6 pad-b4">
                            <div class="form-group">
                                <span class="s_detail-lword">手机号： </span>
                                {$uRes.tel}
                            </div>
                        </div>
                        <div class="col-lg-4 col-md-6 col-md-12 col-xs-6 pad-b4">
                            <div class="form-group">
                                <span class="s_detail-lword">状态： </span>
                                <eq name="uRes.status" value="1">
                                    正常
                                    <else />
                                    冻结
                                </eq>
                            </div>
                        </div>
                    </form>
                    <form class="form-horizontal s_input-bgcolor s_overflow">
                        <div class="col-lg-4 col-md-6 col-md-12 col-xs-6 pad-b4">
                            <div class="form-group">
                                <span class="s_detail-lword">姓名： </span>
                                {$uRes.real_name}
                            </div>
                        </div>
                        <div class="col-lg-4 col-md-6 col-md-12 col-xs-6 pad-b4">
                            <div class="form-group">
                                <span class="s_detail-lword">注册时间： </span>
                                {$uRes.addtime}
                            </div>
                        </div>
                    </form>
                    <form class="form-horizontal s_input-bgcolor s_overflow">
                        <div class="col-lg-4 col-md-6 col-md-12 col-xs-6 pad-b4">
                            <div class="form-group">
                                <span class="s_detail-lword">性别： </span>
                                <eq name="ueRes.Sex" value="2">
                                    女
                                    <else />
                                    男
                                </eq>
                            </div>
                        </div>
                        <div class="col-lg-4 col-md-6 col-md-12 col-xs-6 pad-b4">
                            <div class="form-group">
                                <span class="s_detail-lword">最后登录IP： </span>
                                {$uRes.ip}
                            </div>
                        </div>
                    </form>

                    <div class="row">
                        <form>
                            <div class="s_form-textarea">
                                <span>登录密码</span>
                                <input type="password" class="s_form-width" id="passwd" placeholder="请输入登录密码">
                                <button type="button" class="s_user-modify" onclick="editLoginPwd()">修改登录密码</button>
                            </div>
                            <div class="s_form-textarea">
                                <span>数字密码</span>
                                <input type="text" class="s_form-width" id="safepwd" placeholder="请输入数字密码">
                                <button type="button" class="s_user-modify" onclick="editSafePwd()">修改数字密码</button>
                            </div>
                            <div style="margin: 50px 80px;">
                                <a href="{$Think.config.DOMAIN_URL}/user/index?p={$page}" class="btn " style="width: 100px; border-radius: 2rem; background: #0451d7!important;border:1px solid #0451d7;margin-left: 20px;">返回</a>
                            </div>
                        </form>
                    </div>
                </div>
                <!-- /.row -->
            </div>
            <!-- 财务信息-->
            <div class="col-xs-12 syxx" id="cwxx" style="display: none">
                <div class="pad-t20">
                    <form class="form-horizontal s_input-bgcolor s_overflow">
                        <div class="col-xs-12 pad-b4">
                            <div class="form-group">
                                <span class="s_detail-lword">余额： </span>
                                <img src="{$Think.config.DOMAIN_URL}/Public/AdminTpl/img/user/money_icon.png" alt="无", class="s_user-icon"/>
                                <span class="s_edit-monspan">{$userBalance[BALANCE_MONEY]|default="0"}</span>
                                <button type="button" class="s_user-modify" style="width: 60px;padding: 3px 0;" onclick="rechargeAsset('money',this)">充值</button>
                                <button type="button" class="s_user-modify s_user-dedu" style="width: 60px;padding: 3px 0;" onclick="deducAsset('money',this)">扣款</button>
                            </div>
                        </div>
                        <div class="col-xs-12 pad-b4">
                            <div class="form-group">
                                <span class="s_detail-lword">金币： </span>
                                <img src="{$Think.config.DOMAIN_URL}/Public/AdminTpl/img/user/jinbi_icon.png" alt="无", class="s_user-icon"/>
                                <span class="s_edit-monspan">{$userBalance[BALANCE_COIN]|default="0"}</span>
                                <button type="button" class="s_user-modify" style="width: 60px;padding: 3px 0;" onclick="rechargeAsset('coin',this)">充值</button>
                                <button type="button" class="s_user-modify s_user-dedu" style="width: 60px;padding: 3px 0;" onclick="deducAsset('coin',this)">扣款</button>
                            </div>
                        </div>
                    </form>
                    <a href="{$Think.config.DOMAIN_URL}/user/index?p={$page}" class="btn " style="width: 100px; border-radius: 2rem; background: #0451d7!important;border:1px solid #0451d7;margin-left: 60px;margin-top: 20px;">返回</a>
                </div>
                <!-- /.row -->
            </div>
            <!-- 认证信息-->
            <div class="widget-box transparent col-xs-12 syxx" id="rzxx" style="display: none">
                <h4 class="business-title s_bus-title"><em></em>个人认证信息</h4>
                <div class="widget-body">
                    <div class="widget-main padding-10">
                        <div class="row">
                            <div class="col-xs-12">
                                <div class="s_form-border" style="width:83%;overflow:hidden;">
                                    <form class="form-horizontal s_input-bgcolor s_overflow">
                                        <div class="col-lg-4 col-md-6 col-md-12 col-xs-6 pad-b4">
                                            <div class="form-group">
                                                <span class="s_detail-lword">真实姓名： </span>
                                                {$uRes.real_name}
                                            </div>
                                        </div>
                                        <div class="col-lg-4 col-md-12 col-md-12 col-xs-6 pad-b4">
                                            <div class="form-group">
                                                <span class="s_detail-lword">身份证号： </span>
                                                {$uRes.card_no}
                                            </div>
                                        </div>
                                    </form>
                                    <form class="form-horizontal s_input-bgcolor s_overflow">
                                        <div class="col-lg-12 col-md-12 col-md-12 col-xs-6 pad-b4">
                                            <div class="form-group">
                                                <span class="s_detail-lword">身份证件： </span>
                                                <div class="s_detail-imgblock">
                                                    <div class="s_comm-img">
                                                        <div class="s_comm-imgover">
                                                            <img src="{$ueRes.CardFrontId}" alt="无",/>
                                                        </div>
                                                        <p>身份证正面</p>
                                                    </div>
                                                    <div class="s_comm-img">
                                                        <div class="s_comm-imgover">
                                                            <img src="{$ueRes.CardBackId}" alt="无",/>
                                                        </div>
                                                        <p>身份证反面</p>
                                                    </div>
                                                    <div class="s_comm-img">
                                                        <div class="s_comm-imgover">
                                                            <img src="{$ueRes.CardHandId}" alt="无",/>
                                                        </div>
                                                        <p>手持身份证</p>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                                <a href="{$Think.config.DOMAIN_URL}/user/index?p={$page}" class="btn " style="width: 100px; border-radius: 2rem; background: #0451d7!important;border:1px solid #0451d7;margin-left: 40px;margin-top: 20px;">返回</a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

    <script>
        $('.lecturer-contet-title li').click(function(){
            $('.lecturer-contet-title li').removeClass('border-blue');
            $('.syxx').hide();
            var mapId = $(this).attr('mapid');
            $('#'+mapId).show();
            $(this).addClass('border-blue');
        });
        var uid = '{$uRes.id}';
        //修改登录密码
        function editLoginPwd(){
            var lpwd = $('#passwd').val();
            if(lpwd.length<=0){
                layer.msg('密码不能为空！', {icon: 5,time: 1500});
                return false;
            }
            $.post('/user/editLoginPwd',{uid:uid,lpwd:lpwd},function(data){
                if(data.code == 0){
                    layer.msg('操作成功', {icon: 6,time: 1500});return;
                }else{
                    layer.msg(data.msg, {icon: 5,time: 1500});return;
                }
            });
        }
        //修改数字密码
        function editSafePwd(){
            var safepwd = $('#safepwd').val();
            if(safepwd.length<=0){
                layer.msg('数字密码不能为空！', {icon: 5,time: 1500});
                return false;
            }
            $.post('/user/editSafePwd',{uid:uid,safepwd:safepwd},function(data){
                if(data.code == 0){
                    layer.msg('操作成功', {icon: 6,time: 1500});return;
                }else{
                    layer.msg(data.msg, {icon: 5,time: 1500});return;
                }
            });
        }
        var assetType = [];
        assetType['money'] = '余额';
        assetType['coin'] = '金币';
        //充值资产
        function rechargeAsset(type,that){
            $.popup({
                type: 3,
                title: '充值'+assetType[type],
                main: [
                    {key:'充值金额',val:'input',hint:'请输入充值金额'},
                    {key:'备注信息',val:'input',hint:'请输入备注信息'}
                ],
                callback: function (json,dom) {
                    if(json.key0 && json.key1){
                        $.popup.proto.close();
                        $.post('/user/rechargeAsset',{uid:uid,type:type,money:json.key0,memo:json.key1},function(data){
                            if(data.code == 0){
                                $(that).parent().find('.s_edit-monspan').text(data.money);
                                layer.msg('操作成功', {icon: 6,time: 1500});return;
                            }else{
                                layer.msg(data.msg, {icon: 5,time: 1500});return;
                            }
                        });
                    }
                }
            });
        }
        //扣除资产
        function deducAsset(type,that){
            $.popup({
                type: 3,
                title: '扣款'+assetType[type],
                main: [
                    {key:'扣款金额',val:'input',hint:'请输入扣款金额'},
                    {key:'备注信息',val:'input',hint:'请输入备注信息'}
                ],
                callback: function (json,dom) {
                    if(json.key0 && json.key1){
                        $.popup.proto.close();
                        $.post('/user/deducAsset',{uid:uid,type:type,money:json.key0,memo:json.key1},function(data){
                            if(data.code == 0){
                                $(that).parent().find('.s_edit-monspan').text(data.money);
                                layer.msg('操作成功', {icon: 6,time: 1500});return;
                            }else{
                                layer.msg(data.msg, {icon: 5,time: 1500});return;
                            }
                        });
                    }
                }
            });
        }
    </script>

</block>
